const express = require("express");
const router = express.Router();

const userinfo_handler = require("../router_handler/userinfo");

const expressJoi = require("@escook/express-joi");
const {
  update_userinfo_schema,
  update_userpic_schema,
} = require("../schema/user");

// 获取用户信息
router.get("/userinfo", userinfo_handler.getUserinfo);
// 更新用户信息
router.post(
  "/updateUserinfo",
  expressJoi(update_userinfo_schema),
  userinfo_handler.updateUserinfo
);
// 更新用户头像
router.post(
  "/update/avatar",
  expressJoi(update_userpic_schema),
  userinfo_handler.updateUserPic
);

module.exports = router;
